package com.common.retrofit.methods;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class TixianMethods extends BaseMethods {

    private static TixianMethods m_ins = null;

    public static TixianMethods getInstance() {
        if (m_ins == null) {
            synchronized (TixianMethods.class) {
                if (m_ins == null) {
                    m_ins = new TixianMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "Api/bill_Record/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void     encashment(Subscriber<Object> subscriber,
                      int uid,
                      String hashid ,String money,String name,String alipay  ) {
        Observable observable = initService().encashment(System.currentTimeMillis()+"",
                SortUtils.getMyHash("uid","hashid","name","money","alipay"), Constans.ANDROID_APP_ID,"3",
                uid,hashid,money,name,alipay
        );
        toSubscribe(observable, subscriber);
    }
}
